//
//  AWTheme.m
//  changeShin
//
//  Created by Alan Wang on 2019/3/25.
//  Copyright © 2019 Alan Wang. All rights reserved.
//

#import "AWTheme.h"

@implementation AWTheme
-(instancetype)init{
    self = [super init];
    if(self){
        _blockDataDict = [[NSMutableDictionary alloc] init];
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateSakuraSkins) name:AWThemeSkinChangeNotification object:nil];
    }
    return self;
}
-(void)updateSakuraSkins{
    for (themeSkinBlock block in _blockDataDict.allValues) {
        if(block){
            block();
        }
    }
}

- (void)dealloc {
    [[NSNotificationCenter defaultCenter] removeObserver:self name:AWThemeSkinChangeNotification object:nil];
}

@end
